package myfirstjunit;

import org.junit.*;
import static org.junit.Assert.*;

/**
 *
 * @author x00049379
 */
public class MyFirstJUnitTest {
    
    public MyFirstJUnitTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }

    /**
     * Test of main method, of class MyFirstJUnit.
     */
    @Test
    public void testMain() {
        System.out.println("main");
        String[] args = null;
        MyFirstJUnit.main(args);
        // TODO review the generated test code and remove the default call to fail.
        //fail("The test case is a prototype.");
    }

    /**
     * Test of grade method, of class MyFirstJUnit.
     */
    @Test
    public void testGrade1() {
        int exam = 39;
        int ca = 100;
        String expResult = "Component Fail";
        System.out.println("grade1 - exam: " + exam + ", ca: " + ca + ", expected: " + expResult);
        String result = MyFirstJUnit.grade(exam, ca);
        assertEquals(expResult, result);
    }
    
    @Test
    public void testGrade2() {
        int exam = 100;
        int ca = 39;
        String expResult = "Component Fail";
        System.out.println("grade2 - exam: " + exam + ", ca: " + ca + ", expected: " + expResult);
        String result = MyFirstJUnit.grade(exam, ca);
        assertEquals(expResult, result);
    }
    
    @Test
    public void testGrade3() {
        int exam = 49;
        int ca = 49;
        String expResult = "Fail";
        System.out.println("grade3 - exam: " + exam + ", ca: " + ca + ", expected: " + expResult);
        String result = MyFirstJUnit.grade(exam, ca);
        assertEquals(expResult, result);
    }
    
    @Test
    public void testGrade4() {
        int exam = 50;
        int ca = 50;
        String expResult = "Pass";
        System.out.println("grade4 - exam: " + exam + ", ca: " + ca + ", expected: " + expResult);
        String result = MyFirstJUnit.grade(exam, ca);
        assertEquals(expResult, result);
    }
    
    @Test
    public void testGrade5() {
        int exam = 79;
        int ca = 79;
        String expResult = "Pass";
        System.out.println("grade5 - exam: " + exam + ", ca: " + ca + ", expected: " + expResult);
        String result = MyFirstJUnit.grade(exam, ca);
        assertEquals(expResult, result);
    }
    
    @Test
    public void testGrade6() {
        int exam = 80;
        int ca = 80;
        String expResult = "Pass";
        System.out.println("grade6 - exam: " + exam + ", ca: " + ca + ", expected: " + expResult);
        String result = MyFirstJUnit.grade(exam, ca);
        assertEquals(expResult, result);
    }
    
    @Test
    public void testGrade7() {
        int exam = 99;
        int ca = 99;
        String expResult = "Pass";
        System.out.println("grade7 - exam: " + exam + ", ca: " + ca + ", expected: " + expResult);
        String result = MyFirstJUnit.grade(exam, ca);
        assertEquals(expResult, result);
    }
    
    @Test
    public void testGrade8() {
        int exam = 100;
        int ca = 100;
        String expResult = "Pass";
        System.out.println("grade8 - exam: " + exam + ", ca: " + ca + ", expected: " + expResult);
        String result = MyFirstJUnit.grade(exam, ca);
        assertEquals(expResult, result);
    }
    
}